<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Jedrzej\Pimpable\PimpableTrait;

class MemberShip extends Model
{
    use HasFactory;
    use PimpableTrait;
    use SoftDeletes;

    public  $typeEnum = [
        'month' => '月卡会员',
        'quarter' => '季卡',
        'year' => '年卡',
        'ever' => '永久',
        'free' => '免费',
    ];

    /**
     * 默认排序
     */
    protected $defaultSortCriteria = ['id,desc'];

    /**
     * 可排序字段
     */
    public $sortable = [
        'created_at',
        'id',
        'vip_day',
        'price',
        'new_price',
    ];

    /**
     * 可搜索字段
     */
    public $searchable = [
        'id',
        'type',
        'title',
        'vip_day',
        'price',
        'new_price',
    ];
    /**
     * 会员类型表可批量赋值字段
     */
    protected $fillable = [
        'type',
        'title',
        'vip_day',
        'price',
        'pre_price',
        'order',
    ];


}
